package net.zjitc.springboot.Exception;

import net.zjitc.springboot.common.Result;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author 何景航
 * @date 2025/5/14 11:02
 */
@ControllerAdvice("net.zjitc.springboot.controller")
public class GlobalExceptionHandler {
    @ExceptionHandler(Exception.class)
    @ResponseBody
    public Result handleException(Exception e) {
        e.printStackTrace();
        return Result.error();
    }
}
